<form method="post" enctype="multipart/form-data" target="_blank" id="goods_list_form">
    <div class="table-responsive">
        <table class="table table-bordered table-hover">
            <thead>
            <tr>
                <td style="width: 1px;" class="text-center">

                </td>
                <td class="text-right">
                    <a href="javascript:sort('goods_id');">ID</a>
                </td>
                <td class="text-left">
                    <a href="javascript:sort('goods_name');">任务名称</a>
                </td>
                <td class="text-left">
                    <a href="javascript:sort('goods_sn');">任务数量</a>
                </td>
                <td class="text-left">
                    <a href="javascript:sort('cat_id');">分类</a>
                </td>
                <td class="text-left">
                    <a href="javascript:sort('shop_price');">价格</a>
                </td>
                <td class="text-center">
                    <a href="javascript:sort('is_recommend');">推荐</a>
                </td>

                <td class="text-center">
                    <a href="javascript:sort('is_hot');">热卖</a>
                </td>

                <td class="text-left">
                    <a href="javascript:sort('is_on_sale');">上/下架</a>
                </td>

                <td class="text-right">操作</td>
            </tr>
            </thead>
            <tbody>
            <volist name="goodsList" id="list">
                <tr>
                    <td class="text-center">
                        <input type="checkbox" name="goods_id[]" value="{$list.goods_id}"/>
                    </td>
                    <td class="text-right">{$list.goods_id}</td>
                    <td class="text-left">{$list.goods_name|getSubstr=0,33}</td>
                    <td class="text-left">{$list.store_count}</td>
                    <td class="text-left">{$list.type}</td>
                    <td class="text-left">{$list.shop_price}</td>
                    <td class="text-center">
                        <img width="20" height="20"
                             src="__PUBLIC__/images/<if condition='$list[is_recommend] eq 1'>yes.png<else />cancel.png</if>"
                             onclick="changeTableVal('goods','goods_id','{$list.goods_id}','is_recommend',this)"/>
                    </td>

                    <td class="text-center">
                        <img width="20" height="20"
                             src="__PUBLIC__/images/<if condition='$list[is_hot] eq 1'>yes.png<else />cancel.png</if>"
                             onclick="changeTableVal('goods','goods_id','{$list.goods_id}','is_hot',this)"/>
                    </td>

                    <td class="text-left">
                        <if condition="$list[is_on_sale] eq 0">下架</if>
                        <if condition="$list[is_on_sale] eq 1">上架</if>
                    </td>

                    <td class="text-right">
                        <a href="{:U('Goods/addEditGoods',array('id'=>$list['goods_id']))}" data-toggle="tooltip"
                           title="" class="btn btn-primary" data-original-title="编辑"><i class="fa fa-pencil"></i></a>
                        <a href="javascript:void(0);" onclick="del('{$list[goods_id]}')" id="button-delete6"
                           data-toggle="tooltip" title="" class="btn btn-danger" data-original-title="删除"><i
                                class="fa fa-trash-o"></i></a>

                    </td>
                </tr>
            </volist>
            </tbody>
        </table>
    </div>
</form>
<div class="row">
    <div class="navbar-form form-inline">
        全选
        <input type="checkbox" onclick="$('input[name=\'goods_id\[\]\']').prop('checked', this.checked);">
        <div class="form-group">
            <select id="func_id" class="form-control" style="width: 120px;" onchange="fuc_change(this);">
                <option value="-1">请选择...</option>
                <option value="0">推荐</option>
                <option value="1">新品</option>
                <option value="2">热卖</option>
                <option value="3">审核商品</option>
            </select>
        </div>
        <div class="form-group" id="state_div">
            <select id="state_id" class="form-control" style="display: none" onchange="state_change(this);">
                <option value="">请选择...</option>
                <foreach name="goods_state" item="vo">
                    <option value="{$key}">{$goods_state[$key]}</option>
                </foreach>
            </select>
        </div>
        <button id="act_button" type="button" onclick="act_submit();" class="btn btn-primary disabled"><i
                class="fa"></i> 确定
        </button>
    </div>
    <div class="col-sm-9 text-right">{$page}</div>
</div>
<script>
    // 点击分页触发的事件
    $(".pagination  a").click(function () {
        cur_page = $(this).data('p');
        ajax_get_table('search-form2', cur_page);
    });
</script>